local function main(userOb, msgData)
  if not msgData.GoodFriendId then
    return
  end
  local userId = userOb:query_temp("userId")
  local result = {}
  local rpc = {}
  rpc.behavior = "add"
  rpc.method = "change_challenge"
  rpc.from_user = userId
  rpc.to_user = msgData.GoodFriendId

  --!获取玩家信息
  local Friend_userOb = USER_OB:create()

  Friend_userOb:set_temp("userId", msgData.GoodFriendId)
  local ok = Friend_userOb:load()

  local level = Friend_userOb:get_level() + 1000

  local partner_array = Friend_userOb:get_partner_array()
  local equip = Friend_userOb:get_equip()
  local equip_type= Friend_userOb:get_equip()

  local ok, data = THREAD_D:send("database_yield", rpc)

  result.code = 200
  result.status = "success"
  result.equip = equip
  result.equip_type = equip_type
  result.partner_array = partner_array
  result.level = level
  userOb:send_packet("MSGS2CChallenge", result)
end

--注册方法
COMMAND_D:register_command("MSGC2SChallenge",GameCmdType.NONE, main)
